//
//  NSString+height.m
//  ITgo
//
//  Created by zhaochunlin.guixing on 15/10/27.
//  Copyright (c) 2015年 guixing. All rights reserved.
//

#import "NSString+height.h"

@implementation NSString (height)

-(CGFloat)heightWithfont:(UIFont *)font width:(CGFloat)width{
   CGSize size=[self boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
    return size.height;
    
}
-(CGFloat)widthWithfont:(UIFont *)font height:(CGFloat)height{
    CGSize size=[self boundingRectWithSize:CGSizeMake(MAXFLOAT, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
    return size.width;
}

@end
